home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / utilz / unpcklbm / test.asm < prev    next >
Assembly Source File  |  1996-01-04  |  2KB  |  101 lines

  1. ;────────────────────────────────────────────────────────────────────────────
  2. ; This is just made to demonstrate my unpack-routine for 256color LBM-Files.
  3. ; Nothing to be proud of, just only to show how it works ....
  4. ;
  5. ; I used the IDEAL-mode of Tasm adn Tran's Pmode-Extender v2.5
  6. ;
  7. ;────────────────────────────────────────────────────────────────────────────
  8.  
  9. ideal
  10. p386
  11.  
  12. segment  code32  para public use32
  13. assume cs:code32
  14. assume ds:code32
  15.  
  16. public _main
  17.  
  18. masm
  19. include pmode.inc
  20. ideal
  21.  
  22. _main:          sti
  23.  
  24.                 mov edx,offset filename   ; opens a gfx-file, reads it and
  25.                 call _openfile            ; close it at the end
  26.                 jc error
  27.  
  28.                 mov edx,offset buffer
  29.                 mov ecx,0ffffh
  30.                 call _readfile
  31.                 jc error
  32.  
  33.                 call _closefile
  34.                 jc error
  35.  
  36.  
  37.                 mov [ds:v86r_ax],0013h
  38.                 mov al,10h
  39.                 int 33h
  40.  
  41.                 mov esi,offset buffer
  42.                 mov cx,64000
  43.                 mov edi,offset depack_buffer
  44.                 
  45.                 call unpack_lbm           ; unpacks the graphics on the 
  46.                                           ; screen and store the colors in
  47.                                           ; the palette-buffer
  48.                 jc error
  49.                 
  50.                 mov esi,[color_table]
  51.  
  52.                 mov cx,768
  53.                 mov dx,03c8h
  54.                 xor al,al
  55.                 out dx,al
  56.                 inc dx
  57. color_set:      mov al,[esi]
  58.                 shr al,2
  59.                 out dx,al
  60.                 inc esi
  61.                 dec cx
  62.                 jnz color_set
  63.  
  64.                 mov ecx,[Bitmap_Bytes]
  65.                 mov esi,offset depack_buffer
  66.                 xor edi,edi
  67. xtx:            mov eax,[ds:esi]
  68.                 mov [gs:0a0000h+edi],eax
  69.                 inc esi
  70.                 inc edi
  71.                 dec cx
  72.                 jnz xtx
  73.  
  74.                 
  75. warte:          in al,60h
  76.                 cmp al,01h
  77.                 jne warte
  78.  
  79. error:          mov [ds:v86r_ax],0003h
  80.                 mov al,10h
  81.                 int 33h
  82.                 
  83.                 mov ax,4c00h
  84.                 int 21h
  85.  
  86.  
  87. include "unp_lbm.asm"
  88.  
  89.  
  90. filename        db "test.lbm",0
  91.  
  92. buffer          db 64000 dup (?)
  93. depack_buffer   db 64000 dup (?)
  94.  
  95. ends  code32
  96.  
  97. end _main
  98.  
  99.  
  100.  
  101.